package uk.ac.glasgow.demosocs.tests;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Date;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import uk.ac.glasgow.demosocs.VotingSystem;
import uk.ac.glasgow.demosocs.impl.VotingSystemStub;

public class ViewElectionsTest{	
	VotingSystem vs;
	

	@Before
	public void setUp() throws Exception{
		vs = new VotingSystemStub();		
		vs.setCurrentUser("002","pass");
		Date open = new Date(11, 02, 2012);
		Date start = new Date(13,03,2012);
		Date end = new Date(23,03,2012);
		vs.createElection("test", "P");		
		vs.editElection(open, start, end, "003");				
		vs.createElection("test2", "P");
		vs.editElection(open, start, end, "009");
		
	}

	@After
	public void tearDown() throws Exception{
		vs = null;
	}

	@Test 
	public void testViewElections() throws IOException{
		System.out.println("View Elections");
		System.out.println(vs.getElections());		
	}
}